﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Extensions;

namespace Common.UI.Controls.Utils
{
	public class IntBarChartItemsSource : BarChartItemsSourceBase<Int32>
	{
		public IntBarChartItemsSource(IList<BarItem<Int32>> frontItems, IList<BarItem<Int32>> backItems) : base(frontItems, backItems) { }

		public override Int32 GetMax(params BarItem<Int32>[] values)
		{
			if (values.IsNullOrEmpty())
				return 0;

			return values.Max(x => x.Value);
		}

		public override Int32 GetMax(Int32 item1, Int32 item2)
		{
			return Math.Max(item1, item2);
		}
	}
}
